package com.zhucan.autoconfigure.xxl;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author: zhuCan
 * @date: 2020/6/5 9:29
 * @description:
 */
@ConfigurationProperties(prefix = "xxl.job")
public class XxlProperties {

  private String adminUrl = "http://localhost:8995";

  private Executor executor = new Executor();

  private String accessToken = "";

  private Boolean enable;

  public String getAdminUrl() {
    return adminUrl;
  }

  public void setAdminUrl(String adminUrl) {
    this.adminUrl = adminUrl;
  }

  public Executor getExecutor() {
    return executor;
  }

  public void setExecutor(Executor executor) {
    this.executor = executor;
  }

  public String getAccessToken() {
    return accessToken;
  }

  public void setAccessToken(String accessToken) {
    this.accessToken = accessToken;
  }

  public Boolean getEnable() {
    return enable;
  }

  public void setEnable(Boolean enable) {
    this.enable = enable;
  }

  public static class Executor {

    private String ip;
    private Integer port = 8996;
    private String appName = "";
    private String logPath = "";
    private Integer logRetentionDays = -1;

    public String getIp() {
      return ip;
    }

    public void setIp(String ip) {
      this.ip = ip;
    }

    public Integer getPort() {
      return port;
    }

    public void setPort(Integer port) {
      this.port = port;
    }

    public String getAppName() {
      return appName;
    }

    public void setAppName(String appName) {
      this.appName = appName;
    }

    public String getLogPath() {
      return logPath;
    }

    public void setLogPath(String logPath) {
      this.logPath = logPath;
    }

    public Integer getLogRetentionDays() {
      return logRetentionDays;
    }

    public void setLogRetentionDays(Integer logRetentionDays) {
      this.logRetentionDays = logRetentionDays;
    }
  }
}
